import request from "@/utiles/request";
//获取文件列表
export const getFileListAPI = () => request.get("/file/list");
//创建文件夹
export const createFileAPI = (data) => request.post("/file/create", data);
//修改文件夹
export const updateFileAPI = (data) => request.put("/file/rename", data);
//删除文件夹
export const deleteFileAPI = (id, data) =>
  request.post(`/file/delete?id=${id}`, data);
//获取对应文件夹下的文件列表
export const getFileListByIDAPI = (parentId, fileName, pageNo , pageSize = 10) =>
  request.get(`/file/getFiles?parentId=${parentId}&fileName=${fileName}&pageNo=${pageNo}&pageSize=${pageSize}`);
//通过formData上传文件
export const uploadFileAPI = (parentId,formData)=>{
    return request.post(`/file/upload?parentId=${parentId}`,formData)
}
//删除文件
export const deleteFileByIDAPI = (id)=>request.delete(`/file/deleteFile?id=${id}`)